package org.oka.camsa.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.IdentityType;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Item implements Serializable {

	private static final long serialVersionUID = 1L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")  
	private String key;

	@Persistent
	private String catalanName = "";

	@Persistent
	private String spanishName = "";

	@Persistent
	private String englishName = "";

	@Persistent
	private String comments = "";
	
	@Persistent
	private List<Price> priceHistory;

	public Item(String catalanName, String spanishName, String englishName,
			String comments) {
		super();
		this.catalanName = catalanName;
		this.spanishName = spanishName;
		this.englishName = englishName;
		this.comments = comments;
		this.priceHistory = new ArrayList<Price>();		
	}

	public Item() {
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getCatalanName() {
		return catalanName;
	}

	public void setCatalanName(String catalanName) {
		this.catalanName = catalanName;
	}

	public String getSpanishName() {
		return spanishName;
	}

	public void setSpanishName(String spanishName) {
		this.spanishName = spanishName;
	}

	public String getEnglishName() {
		return englishName;
	}

	public void setEnglishName(String englishName) {
		this.englishName = englishName;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	public void setPriceHistory(List<Price> priceHistory) {
		this.priceHistory = priceHistory;
	}

	public List<Price> getPriceHistory() {
		return priceHistory;
	}
}